<html>
<head>
    <meta name="layout" content="grame"/>
    <title>修改密码</title>
    <asset:stylesheet src="signin"/>
</head>

<body>
<div class="container">
    <div class="row">
        <div class="col-xs-offset-2 col-xs-8 col-sm-offset-3 col-sm-6">
            <g:form id="formChangePassword" action="changePassword" class="form-group form-group-lg" role="form">
                <h2 class="panel-heading">Enter new password</h2>
                <g:if test="${flash.message}"><div class="message">${flash.message}</div></g:if>
                <input type="password" class="form-control" placeholder="Password" value="" required/>
                <input type="password" class="form-control" placeholder="Confirm password" value="" required/>
                <input type="hidden" id="password" name="password" value=""/>
                <button class="btn btn-lg btn-primary btn-block" onclick="return checkPass()">Sign in</button>
            </g:form>
        </div>
    </div>
</div>
<content tag="script">
    <asset:javascript src="auth"/>
    <script type="text/javascript">
        function checkPass() {
            var $passwords = $(".form-signin input[type=password]");
            if ($passwords[0].value == $passwords[1].value) {
                $('#password').val(maskPassword($passwords[1].value));
                $("#formChangePassword").submit();
                return true;
            } else {
                alert("两次密码输入不一致");
                return false;
            }
        }
    </script>
</content>
</body>
</html>